package com.kgcx.opc.common.utils.String;

import com.alibaba.fastjson.util.TypeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CityUtils {
    private static final Logger LOG = LoggerFactory.getLogger(CityUtils.class);
    public static String toStringCode(String code) {
        String s = String.valueOf(code);
        if (s.length() < 6) {
            int length = s.length();
            for (int i = 0; i < 6 - length; i++) {
                s = s + "0";
            }
        }
        return s;
    }
    public static Integer toIntCode(String code) {
        return TypeUtils.castToInt(code);
    }

    public static Integer toIntCityCode(String code) {
        String s = String.valueOf(code);
        if (s.length() < 6) {
            int length = s.length();
            for (int i = 0; i < 6 - length; i++) {
                s = s + "0";
            }
        }
        return TypeUtils.castToInt(s);
    }

}
